package com.account.common.enums;

/**
 * Created by GPL on 2017/8/12.
 */
public enum YnEnum {
    YES(1, "是"),
    NO(0, "否");

    private int key;
    private String description;

    YnEnum(int key, String description) {
        this.key = key;
        this.description = description;
    }

    public static YnEnum get(int key) {
        YnEnum re = null;
        for (YnEnum e : YnEnum.values()) {
            if (e.getKey() == key) {
                re = e;
                break;
            }
        }
        return re;
    }

    public int getKey() {
        return key;
    }

    public String getDescription() {
        return description;
    }

}
